<template>
  <div class="intelligence">
    <div class="intelligenceBanner">
      <img class="imtell_img" :src="list.img" alt="" />
      <div class="intell_cont">
        <h2>{{ list.titte }}</h2>
        <p>{{ list.english }}</p>
        <div v-html="list.content" id="bannerConent">{{ list.content }}</div>
        <el-button
          @click="zixun"
          class="btn"
          :style="
            'border-color:' + list.buttonColour + '; color:' + list.buttonColour
          "
          >售前咨询</el-button
        >
        <el-button
          class="btn"
          v-if="useState"
          :style="
            'background:' + list.buttonColour + '; color: #fff;border:none'
          "
          @click="initPlat"
          >进入平台</el-button
        >
      </div>
    </div>
    <div class="introduce">
      <div class="content">
        <h2>介 绍</h2>
        <p>introduce</p>
        <div v-html="content.content" id="introduceContent">
          {{ content.content }}
        </div>
      </div>
    </div>
    <div class="value">
      <h2>价 值</h2>
      <p>value</p>
      <div class="valueList">
        <ul>
          <li v-for="(item, index) in value" :key="item.id">
            <div class="icon" style="text-align: center">
              <img v-if="index == 0" src="@/assets/icon/medal.png" />
              <img v-if="index == 1" src="@/assets/icon/Diamonds.png" />
              <img v-if="index == 2" src="@/assets/icon/shield.png" />
            </div>
            <h3>{{ item.img }}</h3>
            <div id="valueContent">
              <div class="value_icon">
                <div class="mark"></div>
                <div class="mark"></div>
                <div class="mark"></div>
              </div>
              <div class="value_text" v-html="item.content">
                {{ item.content }}
              </div>
            </div>
          </li>
        </ul>
      </div>
    </div>
    <Perssion @close="visible = false" :visible="visible" />
    <!-- 弹窗 -->
    <el-dialog
      title="联系我们"
      :visible.sync="centerDialogVisible"
      width="20%"
      center
      custom-class="connectIphone"
    >
      <div class="connectOur">
        <i class="el-icon-phone phone"></i>
        <div class="serve"><span>客服一：</span>010-67631224</div>
        <div class="serve"><span>客服二：</span>010-67634847</div>
        <div class="tip">温馨提示：将由专属客服接听电话为您服务</div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import Perssion from "@/components/popup/index.vue";
import { mapGetters } from "vuex";
export default {
  name: "operate",
  components: { Perssion },
  props: {
    active: {
      type: String,
      default: () => {
        return "0";
      },
    },
    list: {
      type: Object,
      default: () => {
        return {};
      },
    },
    content: {
      type: Object,
      default: () => {
        return {};
      },
    },
    value: {
      type: Array,
      default: () => {
        return [];
      },
    },
  },
  data() {
    return {
      visible: false,
      centerDialogVisible: false,
    };
  },
  computed: {
    ...mapGetters(["useState", "menu"]),
  },
  methods: {
    initPlat() {
      var menuList = [];
      if (typeof this.menu === "string") {
        menuList = JSON.parse(this.menu);
      } else {
        menuList = this.menu;
      }
      var leys = [];
      if (menuList.PlatformChange) {
        menuList.PlatformChange.map((item) => {
          if (item.id == "1408300574369255424") {
            leys.push("1");
          } else if (item.id == "1408265588417105920") {
            leys.push("2");
          } else if (item.id == "1408265650929012736") {
            {
              leys.push("3");
            }
          } else if (item.id == "1408265765383180288") {
            {
              leys.push("4");
            }
          }
        });
        if (!leys.includes(this.active)) {
          this.visible = true;
        } else {
          this.visible = false;
          this.$router.push({
            path: "/operation",
            query: { active: this.active },
          });
        }
        // console.log(leys);
        // console.log(leys.indexOf("1"));
        // if (this.active == item.key) {
        // this.$router.push({
        //   path: "/operation",
        //   query: { active: this.active },
        // });
        //   } else {
        //     console.log("9999");
        //   }
      } else {
        this.visible = true;
      }
    },
    mouseenter(color) {
      this.$refs.btnColor.background = color;
    },
    mouseleave() {
      this.$refs.btnColor.background = "#fff";
    },
    zixun() {
      this.centerDialogVisible = true;
    },
  },
};
</script>

<style lang="scss" scoped>
/*智慧平台模块样式*/

.intelligence {
  .intelligenceBanner {
    width: 100%;
    height: 535px;
    overflow: hidden;
    position: relative;
    h2 {
      margin-top: 6%;
      font-size: 42px;
      color: #303133;
      line-height: 48px;
      font-weight: 400;
    }
    p {
      margin: 19px 0 28px;
      font-size: 24px;
      font-weight: 800;
      color: #303133;
      line-height: 28px;
      opacity: 0.5;
    }
    #bannerConent {
      width: 50%;
      height: 160px;
      font-size: 14px;
      font-weight: 500;
      color: #666666;
      line-height: 38px;
      margin-bottom: 2%;
      text-overflow: ellipsis;
      overflow: hidden;
      display: -webkit-box;
      -webkit-line-clamp: 4;
      line-clamp: 4;
      -webkit-box-orient: vertical;
    }
    .btn {
      width: 166px;
      height: 43px;
      margin-right: 70px;
      font-size: 16px;
      font-weight: bold;
      color: #0e7fe8;
      background: #ffffff;
      border: 1px solid #0e7fe8;
      // &:hover {
      //   color: #fff;
      // }
    }
  }
  .introduce {
    padding-bottom: 65px;
    background: #f8f9fb;
    .content {
      width: 74%;
      margin: 0 auto;
      overflow: hidden;
      h2 {
        margin: 70px 0 18px;
        font-size: 34px;
        font-weight: bold;
        color: #061a43;
        line-height: 28px;
        text-align: center;
      }
      p {
        font-size: 15px;
        font-weight: 500;
        color: #8a92a1;
        line-height: 28px;
        text-align: center;
      }
      #introduceContent {
        margin-top: 49px;
        font-size: 14px;
        font-weight: 500;
        color: #666666;
        line-height: 38px;
        // text-overflow: ellipsis;
        // overflow: hidden;
        // display: -webkit-box;
        // -webkit-line-clamp: 10;
        // line-clamp: 10;
        // -webkit-box-orient: vertical;
      }
    }
  }
  .value {
    h2 {
      margin: 70px 0 18px;
      font-size: 34px;
      font-weight: bold;
      color: #061a43;
      line-height: 28px;
      text-align: center;
    }
    p {
      font-size: 15px;
      font-weight: 500;
      color: #8a92a1;
      line-height: 28px;
      text-align: center;
    }
    #valueContent {
      width: 100%;
      height: 200px;
      position: relative;
      padding-left: 5%;
      font-size: 16px;
      font-weight: 500;
      color: #333333;
      line-height: 30px;
      overflow: hidden;
      -webkit-box-orient: vertical;
      display: flex;
      flex-direction: row;
      .value_icon {
        width: 40%;
        height: 200px;
      }
      .mark {
        width: 10px;
        height: 10px;
        background: #29c19b;
        transform: rotate(45deg);
        float: right;
        &:nth-child(1) {
          margin-top: 40px;
          margin-left: -9px;
        }
        &:nth-child(2) {
          margin-top: 100px;
          margin-left: -12px;
        }
        &:nth-child(3) {
          margin-top: 160px;
          margin-left: 5px;
        }
      }
      .value_text {
        width: 100%;
        height: 185px;
        margin: 0 25px;
        text-overflow: ellipsis;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 6;
        line-clamp: 6;
        -webkit-box-orient: vertical;
      }
    }
    .valueList {
      width: 74%;
      margin: 0 auto;
      ul {
        display: flex;
        li {
          width: 100%;
          height: 410px;
          margin: 69px 30px 105px 0;
          padding: 20px;
          background: #ffffff;
          box-shadow: 0px 1px 10px 0px rgba(27, 72, 74, 0.11);
          cursor: pointer;
          transition: all 0.2s ease-in;
          &:hover {
            box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
            transform: translate3d(0, -10px, -2px);
            h3 {
              color: #0e7fe8;
            }
          }
          &:nth-child(2) .icon {
            background: rgba(14, 127, 232, 0.1);
          }
          &:last-child .icon {
            background: rgba(91, 81, 223, 0.1);
          }
          &:nth-child(2) #valueContent .mark {
            background: #0e7fe8;
          }
          &:last-child #valueContent .mark {
            background: #5b51df;
          }
          .icon {
            width: 64px;
            height: 64px;
            margin: 29px auto;
            background: rgba(41, 193, 155, 0.1);
            border-radius: 50%;
            img {
              height: 64%;
              margin: 22% auto;
            }
          }
          h3 {
            margin: 25px 0 38px;
            text-align: center;
            font-size: 20px;
            font-weight: bold;
            color: #333333;
          }
        }
      }
    }
  }
}
.intelligence {
  .intelligenceBanner {
    position: relative;
    // background: url('../../assets/image/intelligenceBanner.png') no-repeat;
    background-size: cover;
    .imtell_img {
      width: 100%;
      height: 100%;
      position: absolute;
    }
    .intell_cont {
      width: 74%;
      position: absolute;
      left: 50%;
      margin-left: -37%;
    }
  }
}
.connectOur {
  margin-bottom: 10px;
  .phone {
    font-size: 35px;
    color: rgb(92, 182, 255);
    float: left;
    line-height: 60px;
    margin-left: 20px;
  }
  .serve {
    font-size: 16px;
    text-align: center;
    line-height: 30px;
    width: 92%;
    span {
      margin-right: 10px;
    }
  }
  .tip {
    margin: 30px auto;
    text-align: center;
    color: #999;
    height: 30px;
    line-height: 50px;
    border-top: 1px solid #999;
  }
}
</style>
<style lang="scss">
.connectIphone {
  .el-dialog__body {
    padding-bottom: 2px;
  }
}
</style>
